package com.harmontronics.hanma.paas.paas.domain.organization.entity.valueobject;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum IdentityTypeEnum {

    NORMAL("NORMAL", "普通成员"),
    HIGHER("HIGHER", "上级");

    @EnumValue
    @JsonValue
    private String code;
    private String description;

    IdentityTypeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    IdentityTypeEnum(String code) {
        this.code = code;
    }

    public static IdentityTypeEnum of(String code) {
        IdentityTypeEnum result = null;
        for (IdentityTypeEnum identityTypeEnum : IdentityTypeEnum.values()) {
            if (identityTypeEnum.getCode().equalsIgnoreCase(code)) {
                result = identityTypeEnum;
                break;
            }
        }
        return result;
    }


    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
